package org.springframework.beans.factory.config;

import org.springframework.beans.factory.HierarchicalBeanFactory;
import org.springframework.core.convert.ConversionService;
import org.springframework.util.StringValueResolver;

/**
 * 可扩展的bean工厂
 */
public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, SingletonBeanRegistry {
    /**
     * 增加bean后处理器 扩展bean
     * @param beanPostProcessor
     */
    void addBeanPostProcessor(BeanPostProcessor beanPostProcessor);

    /**
     * 销毁单例bean
     */
    void destroySingletons();

    /**
     * 给bean工厂增加value赋值的解析器
     * @param valueResolver
     */
    void addEmbeddedValueResolver(StringValueResolver valueResolver);

    /**
     * 解析value
     * @param value
     * @return
     */
    String resolveEmbeddedValue(String value);

    /**
     * 设置类型转换器
     * @param conversionService
     */
    void setConversionService(ConversionService conversionService);

    /**
     * 获得类型转换器
     * @return
     */
    ConversionService getConversionService();
}
